<template>
  <!--中间布局-->
  <div class="wrapper activities">
    <div class="activity-card-list">
      <div class="top-title">
        <h4 class="latest">最新活动</h4>
        <div class="clearfix"></div>
      </div>
      <div class="activity-list">
        <ul class="activity">
          <li class="activity-item" v-for="activity in activityList" :key="activity.id">
            <div class="activity-inner">
              <div class="img">
                <a :href="'/activity/'+activity.id" target="_blank">
                  <img :src="activity.image" alt="" /></a>
              </div>
              <div class="text">
                <p class="title">{{activity.name}}</p>
                <div class="fl goin">
                  <p>时间：{{activity.starttime}}</p>
                  <p>城市：{{activity.city}}</p>
                </div>
                <div class="fr btn">
                  <span class="sui-btn btn-bao">立即报名</span>
                </div>
                <div class="clearfix"></div>
              </div>
            </div> </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
  import '~/assets/css/page-sj-activity-index.css'
  import activity from '@/api/activity'
    export default {
        name: "index",
        data(){
          return {
            activityList : []
          }
        },
        created(){
          this.findAllActivitys();
        },
        methods:{
          findAllActivitys(){
            activity.getActivityList().then(({data})=>{
              console.log("data:",data);
              this.activityList = data.data;
            })
          }
        }
    }
</script>

<style scoped>
  .activity{
    margin-left: 6px;
  }
</style>
